$(window).load(function () {
    $(".big-slider").flexslider({
        animation: "slide",
        controlsContainer: ".slider-holder",
        slideshowSpeed: 2500,
        directionNav: true,
        controlNav: true,
        animationDuration: 900
    });
    cutText($(".company-info"), 400);
    cutText($(".company-title"), 20);
    $(".red-btn").click(function (event) {
        event.stopPropagation();
        event.preventDefault();
        $("#container-companies").css("display", "block").css("padding-top", "100px").slideDown("fast", function () {
            $(window).scrollTop(500);
        });
    });
});

function cutText($sel, cut_size) {
    $sel.each(function (i, value) {
        var text = $(value).text();
        var delimiter = "...";
        if (text.length > cut_size) {
            $(this).text(text.substr(0, cut_size) + delimiter);
        }
    });
}